﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="rpt_add.aspx.cs"
    Inherits="NCC_SOP.Admin.rpt_add" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
        .style1
        {
            height: 25px;
        }
        .style2
        {
            height: 25px;
        }
        .required
        {
            color: Red;
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div style="float: left; width: 100%; height: 40px;">
        <asp:Label Font-Size="Large" runat="server">Add New Report</asp:Label>
        <asp:Label ID="errorMsg" Font-Size="Medium" ForeColor="Red" Visible="false" runat="server"></asp:Label>
    </div>
    <div style="float: left; width: 100%; height: 123px;">
        <table style="width: 100%; height: 135px;">
            <tr>
                <td class="style2" style="font-weight: bold; color: #000000">
                    &nbsp; Report Name:
                </td>
                <td class="style2">
                    <asp:TextBox ID="rptName" runat="server"></asp:TextBox><br />
                    
                </td>
                <td class="style1">
                    &nbsp;
                </td>
                <td class="style2" style="font-weight: bold; color: #000000">
                    &nbsp; Data Source:
                </td>
                <td class="style2">
                    &nbsp;
                    <asp:DropDownList ID="DS" runat="server">
                        <asp:ListItem Value="MOSAIQ" Selected="true">MOSAIQ</asp:ListItem>
                        <asp:ListItem Value="CAISIS" Selected="false">CAISIS</asp:ListItem>
                        <asp:ListItem Value="BTB" Selected="false">BTB</asp:ListItem>
                        <asp:ListItem Value="OAS" Selected="false">OAS</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style1" style="font-weight: bold; color: #000000">
                    &nbsp; Report Type:
                </td>
                <td class="style1">
                    &nbsp;
                    <asp:DropDownList ID="rptTypes" runat="server" AutoPostBack="true">
                        <asp:ListItem Value="Clinical Data" Selected="true">Clinical Data</asp:ListItem>
                        <asp:ListItem Value="Clinical Research" Selected="false">Clinical Research</asp:ListItem>
                        <asp:ListItem Value="Operational" Selected="false">Operational</asp:ListItem>
                        <asp:ListItem Value="Quality Control" Selected="false">Quality Control</asp:ListItem>
                    </asp:DropDownList>
                    <br />
                    
                </td>
                <td class="style1">
                    &nbsp;
                </td>
                <td class="style1" style="font-weight: bold; color: #000000">
                    &nbsp; Report Status:
                </td>
                <td class="style1">
                    &nbsp;
                    <asp:RadioButtonList ID="rpt_status" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem ID="active" runat="server" Text="Active" Selected="True" />
                        <asp:ListItem ID="inactive" runat="server" Text="Inactive" />
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
            <td class="style1" style="font-weight: bold; color: #000000">
                &nbsp; Is .Rpt File:</td>
            <td class="style1">
                &nbsp;
                <asp:RadioButtonList id="isRpt" runat="server" 
                    repeatdirection="Horizontal">
                    <asp:ListItem ID="yes" runat="server" Text="Yes" Value="1"/>
                    <asp:ListItem ID="no" runat="server" Text="No" Value="0" Selected/>
                </asp:RadioButtonList>
            </td>
            <td class="style1">
                &nbsp;
            </td>
            <td class="style1" style="font-weight: bold; color: #000000">
                &nbsp;
                URL:</td>
            <td class="style1">
                &nbsp;
                <asp:TextBox ID="rptURL" runat="server"></asp:TextBox>
            </td>
        </tr>
        </table>
    </div>
    <div style="float: left; width: 100%; padding-top: 20px;">
        <p style="font-weight: bold; font-style: italic; color: #000000; font-size: large">
            Report Summary:</p>
        <p>
            <asp:TextBox ID="rptDescription" runat="server" TextMode="MultiLine" Columns="20"
                Rows="20" Height="165px" Width="562px"></asp:TextBox><br />
            
        </p>
    </div>
    <div style="float: left; width: 100%; padding-top: 20px;">
        <div style="float: left; width: 100%;">
            <asp:Label ID="uploadError" ForeColor="Red" Visible="false" runat="server" />
        </div>
        <div style="float: left; width: 100%;">
            <telerik:RadUpload ID="rptUpload" MaxFileSize="5000000" runat="server" MaxFileInputsCount="1"
                AllowedFileExtensions=".pdf">
            </telerik:RadUpload>
        </div>
        <div style="float: left; width: 100%; padding-top: 10px;">
            <asp:Button ID="buttonSubmit" runat="server" CssClass="RadUploadSubmit" OnClick="uploadFile_Click"
                Text="Upload" />
        </div>
        <div class="title" style="float: left; width: 100%; padding-top=10px; color: green">
            Uploaded valid files (*.pdf):
        </div>
        <div style="float: left; width: 100%; padding-top=5px;">
            <asp:Repeater ID="repeaterValidResults" runat="server" Visible="False">
                <ItemTemplate>
                    <%#DataBinder.Eval(Container.DataItem, "FileName")%>
                    (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>)<br />
                    <br />
                </ItemTemplate>
            </asp:Repeater>
           
        </div>
    </div>
    <div style="float: left; width: 100%; padding-top: 20px;">
        <fieldset>
            <legend>Access Right Assignment</legend>
            <div style="float: left; width: 100%;">
                <asp:CheckBoxList ID="roleAssignment" runat="server" RepeatColumns="3" RepeatDirection="Horizontal">
                </asp:CheckBoxList>
            </div>
            
        </fieldset>
    </div>

    <div style="float: left; width: 100%; padding-top: 20px;">
        <fieldset>
            <legend>Departments</legend>
            <div style="float: left; width: 100%;">
                <asp:CheckBoxList ID="departmentAccessRights" runat="server" RepeatColumns="5" RepeatDirection="Horizontal">
                </asp:CheckBoxList>
            </div>
            
        </fieldset>
    </div>

    <div style="float: left; width: 100%; padding-top: 20px;">
        <asp:Button ID="Button1" runat="server" Text="Create" ValidationGroup="AddRpt" CausesValidation="true"
            OnClick="insertRecord" CssClass="RadUploadSubmit" />
    </div>
    <asp:SqlDataSource ID="dsSQLSource" runat="server" ConnectionString="<%$ ConnectionStrings:localSQLString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="select distinct datasource from metaDisplayView ">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="typeSQLSource" runat="server" ConnectionString="<%$ ConnectionStrings:localSQLString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="select distinct dataType from metaDisplayView ">
    </asp:SqlDataSource>
</asp:Content>
